package com.hxexp.weixin.mvc.trafficline.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hxexp.weixin.common.exception.APIException;
import com.hxexp.weixin.common.exception.ServiceException;
import com.hxexp.weixin.hpe.api.trafficline.TrafficLineAPI;
import com.hxexp.weixin.hpe.api.trafficline.model.TrafficLineParamBean;
import com.hxexp.weixin.hpe.api.trafficline.model.TrafficLineResultBean;
import com.hxexp.weixin.mvc.trafficline.service.TrafficlineService;

/**
 * 车票查询服务实现类
 * @author li.jiang
 *
 */
@Service
public final class TrafficlineServiceImpl implements TrafficlineService {

    @Autowired
    private TrafficLineAPI trafficLineAPI;
    @Override
    public TrafficLineResultBean queryTrafficLine(TrafficLineParamBean trafficLineParamBean) throws ServiceException {
        TrafficLineResultBean trafficLineResult = new TrafficLineResultBean();
        try {
            trafficLineResult = trafficLineAPI.queryTrafficLine(trafficLineParamBean);
        } catch (APIException e) {
            throw new ServiceException(e);
        }
        return trafficLineResult;
    }
}
